
;
;
;     Model statements for module:  Create 9
;

247$          CREATE,        1,HoursToBaseTime(0.0),Entity 1:HoursToBaseTime(24):NEXT(248$);

248$          ASSIGN:        Create 9.NumberOut=Create 9.NumberOut + 1:NEXT(87$);


;
;
;     Model statements for module:  Assign 64
;
87$           ASSIGN:        day=day+1:NEXT(88$);


;
;
;     Model statements for module:  Dispose 17
;
88$           ASSIGN:        Dispose 17.NumberOut=Dispose 17.NumberOut + 1;
251$          DISPOSE:       Yes;


115$          CREATE,        1,TFIN:,1:NEXT(116$);

116$          WRITE,         rqueueoutput:
                             
                             tavg(time in receiptq at d1),tavg(time in receiptq at d2),davg(statistic 1),davg(statistic 2),davg(statistic 3),dmax(statistic 1), dmax(statistic 2),dmax(statistic 3),davg(statistic 4),davg(statistic 5),davg(statistic 6),dmax(statistic 4),dmax(statistic 5),dmax(statistic 6),davg(statistic 7),dmax(statistic 7),davg(statistic 8),dmax(statistic 8);
117$          DISPOSE:       No;


124$          CREATE,        1,TFIN:,1:NEXT(125$);

125$          WRITE,         rtimeinsystem:
                             
                             tavg(time in system from d1), tavg(time in system from d2),tavg(time for putaway from d1),tavg(time for putaway from d2);
126$          DISPOSE:       No;


129$          CREATE,        1,TFIN::NEXT(130$);

130$          WRITE,         utilizationf1:
                             FSTAND(forklift1,1),FSTAND(forklift1,2),FSTAND(forklift1,4);
131$          DISPOSE:       No;


132$          CREATE,        1,TFIN::NEXT(133$);

133$          WRITE,         utilizationf2:
                             FSTAND(forklift2,1),FSTAND(forklift2,2),FSTAND(forklift2,4);
134$          DISPOSE:       No;


135$          CREATE,        1,TFIN::NEXT(136$);

136$          WRITE,         utilizationf3:
                             FSTAND(forklift3,1),FSTAND(forklift3,2),FSTAND(forklift3,4);
137$          DISPOSE:       No;


138$          CREATE,        1,TFIN::NEXT(139$);

139$          WRITE,         utilizationf4:
                             FSTAND(forklift4,1),FSTAND(forklift4,2),FSTAND(forklift4,4);
140$          DISPOSE:       No;


141$          CREATE,        1,TFIN::NEXT(142$);

142$          WRITE,         utilizationf5:
                             FSTAND(forklift5,1),FSTAND(forklift5,2),FSTAND(forklift5,4);
143$          DISPOSE:       No;


144$          CREATE,        1,TFIN::NEXT(145$);

145$          WRITE,         utilizationf6:
                             FSTAND(forklift6,1),FSTAND(forklift6,2),FSTAND(forklift6,4);
146$          DISPOSE:       No;


147$          CREATE,        1,TFIN::NEXT(148$);

148$          WRITE,         utilizationd1:
                             FSTAND(dock 1,1),FSTAND(dock 1,2),FSTAND(dock 1,4);
149$          DISPOSE:       No;


150$          CREATE,        1,TFIN::NEXT(151$);

151$          WRITE,         utilizationd2:
                             FSTAND(dock 2,1),FSTAND(dock 2,2),FSTAND(dock 2,4);
152$          DISPOSE:       No;


164$          CREATE,        1,TFIN:,1:NEXT(165$);

165$          WRITE,         squeueoutput:
                             
                             tavg(time in shipmentq at d1),tavg(time in shipmentq at d2),nc(dispatchatruck),nc(dispatchbtruck),nc(dispatchctruck),nc(#runaway),tavg(time for pickup to d1),tavg(time for pickup to d2),tavg(time for loading at d1),tavg(time for loading at d2);
166$          DISPOSE:       No;


171$          CREATE,        1,TFIN:,1:NEXT(172$);

172$          WRITE,         stimeinsystem:
                             
                             tavg(time in system from d1 for shipment),nc(# of trucks that are in system  more than 60 minutes from d1),nc(#of trucks that are from d1),tavg(time in system from d2 for shipment),nc(# of trucks that are in system  more than 60 minutes from d2),nc(#of trucks that are from d2),nc(# of trucks that are in system  more than 45 minutes from d1),nc(# of trucks that are in system  more than 45 minutes from d2);
173$          DISPOSE:       No;


;
;
;     Model statements for module:  Create 114
;

252$          CREATE,        1,NSEXPO(schedule for receipt arrivals),receipt:NSEXPO(schedule for receipt arrivals):NEXT(253$);

253$          ASSIGN:        Create 114.NumberOut=Create 114.NumberOut + 1:NEXT(236$);


;
;
;     Model statements for module:  Assign 200
;
236$          ASSIGN:        producttype=disc(0.6,1,0.9,2,1,3):NEXT(119$);


;
;
;     Model statements for module:  Decide 121
;
119$          BRANCH,        1:
                             If,producttype==1,118$,Yes:
                             If,producttype==2,120$,Yes:
                             Else,121$,Yes;
121$          COUNT:         receiptctruck,1:NEXT(112$);


;
;
;     Model statements for module:  Assign 78
;
112$          ASSIGN:        receiptqenter=tnow:NEXT(110$);

110$          QUEUE,         receiptdockqueue;
100$          SEIZE,         2,Other:
                             SELECT(Docks,LRC,index),1:NEXT(101$);


;
;
;     Model statements for module:  Decide 116
;
101$          BRANCH,        1:
                             If,docks(index)==dock1,258$,Yes:
                             Else,259$,Yes;
258$          ASSIGN:        Decide 116.NumberOut True=Decide 116.NumberOut True + 1:NEXT(113$);

259$          ASSIGN:        Decide 116.NumberOut False=Decide 116.NumberOut False + 1:NEXT(178$);

113$          TALLY:         time in receiptq at d1,tnow-receiptqenter,1:NEXT(0$);


;
;
;     Model statements for module:  Assign 2
;
0$            ASSIGN:        truckcap=8:
                             dockno=1:NEXT(1$);

1$            DUPLICATE:     truckcap-1,68$:NEXT(68$);


;
;
;     Model statements for module:  Process 1
;
68$           ASSIGN:        Process 1.NumberIn=Process 1.NumberIn + 1:
                             Process 1.WIP=Process 1.WIP+1;
289$          STACK,         1:Save:NEXT(263$);

263$          QUEUE,         Process 1.Queue;
262$          SEIZE,         1,VA:
                             SELECT(TransSet4,SNB, ),1:NEXT(261$);

261$          DELAY:         SecondsToBaseTime(UNIF(62,83,61)),,VA:NEXT(304$);

304$          ASSIGN:        Process 1.WaitTime=Process 1.WaitTime + Diff.WaitTime;
268$          TALLY:         Process 1.WaitTimePerEntity,Diff.WaitTime,1;
270$          TALLY:         Process 1.TotalTimePerEntity,Diff.StartTime,1;
294$          ASSIGN:        Process 1.VATime=Process 1.VATime + Diff.VATime;
295$          TALLY:         Process 1.VATimePerEntity,Diff.VATime,1;
260$          RELEASE:       SELECT(TransSet4,LAST),1;
309$          STACK,         1:Destroy:NEXT(308$);

308$          ASSIGN:        Process 1.NumberOut=Process 1.NumberOut + 1:
                             Process 1.WIP=Process 1.WIP-1:NEXT(180$);


;
;
;     Model statements for module:  Assign 110
;
180$          ASSIGN:        beginning time for putaway from d1=tnow:NEXT(104$);

104$          ASSIGN:        product3stock=(producttype==3)*(product3stock+1)+(producttype<>3)*(product3stock+0):
                             product2stock=(producttype==2)*(product2stock+1)+(producttype<>2)*(product2stock+0):
                             product1stock=(producttype==1)*(product1stock+1)+(producttype<>1)*(product1stock+0);
106$          WRITE,         stockr:
                             totalstock,
                             tnow:NEXT(2$);


;
;
;     Model statements for module:  Assign 3
;
2$            ASSIGN:        i=1:NEXT(3$);


;
;
;     Model statements for module:  Assign 4
;
3$            ASSIGN:        replaced=0:NEXT(4$);

4$            WHILE:         (replaced==0):NEXT(7$);


;
;
;     Model statements for module:  Decide 3
;
7$            BRANCH,        1:
                             If,(LocationA(i,1) == 0) ||  ( (producttype  ==  LocationA (i,2)) && (LocationA(i,1) < Capacity) ),
                             311$,Yes:
                             Else,312$,Yes;
311$          ASSIGN:        Decide 3.NumberOut True=Decide 3.NumberOut True + 1:NEXT(6$);

312$          ASSIGN:        Decide 3.NumberOut False=Decide 3.NumberOut False + 1:NEXT(9$);

6$            ASSIGN:        LocationA(i,1)=LocationA(i,1)+1:
                             LocationA(i,2)=producttype:NEXT(10$);


;
;
;     Model statements for module:  Assign 11
;
10$           ASSIGN:        Locationtype=1:NEXT(56$);


;
;
;     Model statements for module:  Decide 45
;
56$           BRANCH,        1:
                             If,dockno==1,313$,Yes:
                             Else,314$,Yes;
313$          ASSIGN:        Decide 45.NumberOut True=Decide 45.NumberOut True + 1:NEXT(203$);

314$          ASSIGN:        Decide 45.NumberOut False=Decide 45.NumberOut False + 1:NEXT(202$);


;
;
;     Model statements for module:  Assign 183
;
203$          ASSIGN:        width1=
                             (LocationA(i,1)==1)*4+(LocationA(i,1)==2)*3+(LocationA(i,1)==3)*2+(LocationA(i,1)==4)*1+(LocationA(i,1)==5)*0:
                             distance1=20+i*1+width1:NEXT(12$);


;
;
;     Model statements for module:  Assign 13
;
12$           ASSIGN:        replaced=1:NEXT(13$);

13$           ENDWHILE:NEXT(53$);


;
;
;     Model statements for module:  Decide 44
;
53$           BRANCH,        1:
                             If,dockno==1,315$,Yes:
                             Else,316$,Yes;
315$          ASSIGN:        Decide 44.NumberOut True=Decide 44.NumberOut True + 1:NEXT(15$);

316$          ASSIGN:        Decide 44.NumberOut False=Decide 44.NumberOut False + 1:NEXT(54$);


;
;
;     Model statements for module:  Seize 2
;
15$           QUEUE,         Seize 2.Queue;
              SEIZE,         2,Other:
                             SELECT(TransSet1,CYC, trans_no1),1:NEXT(318$);

318$          DELAY:         0.0,,VA:NEXT(222$);


;
;
;     Model statements for module:  Decide 229
;
222$          BRANCH,        1:
                             If,stock exceeded<>1,319$,Yes:
                             Else,320$,Yes;
319$          ASSIGN:        Decide 229.NumberOut True=Decide 229.NumberOut True + 1:NEXT(17$);

320$          ASSIGN:        Decide 229.NumberOut False=Decide 229.NumberOut False + 1:NEXT(223$);


;
;
;     Model statements for module:  Delay 1
;
17$           DELAY:         
                             SecondsToBaseTime((Locationtype==1)*((34.521+(0.915*distance1)+NORM(0,7.3))*2)+(Locationtype==2)*((34.521+(0.915*distance3)+NORM(0,7.3))*2)+(Locationtype==3)*((34.521+(0.915*distance5)+NORM(0,7.3))*2)+(Locationtype==4)*((34.521+(0.915*distance7)+NORM(0,7.3))*2)),,
                             Other:NEXT(18$);

18$           RELEASE:       Member(TransSet1, Trans_No1),1;
182$          TALLY:         time for putaway from d1,tnow-beginning time for putaway from d1,1;
153$          ASSIGN:        #unloaded1=#unloaded1+1:NEXT(19$);


;
;
;     Model statements for module:  Decide 6
;
19$           BRANCH,        1:
                             If,#unloaded1==truckcap,321$,Yes:
                             Else,322$,Yes;
321$          ASSIGN:        Decide 6.NumberOut True=Decide 6.NumberOut True + 1:NEXT(20$);

322$          ASSIGN:        Decide 6.NumberOut False=Decide 6.NumberOut False + 1:NEXT(14$);


;
;
;     Model statements for module:  Release 1
;
20$           RELEASE:       dock1,1:NEXT(123$);

123$          TALLY:         time in system from d1,tnow-receiptqenter,1;
154$          ASSIGN:        #unloaded1=#unloaded1-#unloaded1:NEXT(14$);


;
;
;     Model statements for module:  Dispose 1
;
14$           ASSIGN:        Dispose 1.NumberOut=Dispose 1.NumberOut + 1;
323$          DISPOSE:       Yes;


;
;
;     Model statements for module:  Delay 14
;
223$          DELAY:         SecondsToBaseTime(((34.521+(0.915*averagedistance)+Norm(0,7.3))*2)),,Other:NEXT(18$);


;
;
;     Model statements for module:  Seize 15
;
54$           QUEUE,         Seize 15.Queue;
              SEIZE,         2,Other:
                             SELECT(TransSet2,CYC, trans_no2),1:NEXT(325$);

325$          DELAY:         0.0,,VA:NEXT(225$);


;
;
;     Model statements for module:  Decide 230
;
225$          BRANCH,        1:
                             If,stock exceeded<>1,326$,Yes:
                             Else,327$,Yes;
326$          ASSIGN:        Decide 230.NumberOut True=Decide 230.NumberOut True + 1:NEXT(57$);

327$          ASSIGN:        Decide 230.NumberOut False=Decide 230.NumberOut False + 1:NEXT(224$);


;
;
;     Model statements for module:  Delay 11
;
57$           DELAY:         
                             SecondsToBaseTime((Locationtype==1)*((34.521+(0.915*distance2)+NORM(0,7.3))*2)+(Locationtype==2)*((34.521+(0.915*distance4)+NORM(0,7.3))*2)+(Locationtype==3)*((34.521+(0.915*distance6)+NORM(0,7.3))*2)+(Locationtype==4)*((34.521+(0.915*distance8)+NORM(0,7.3))*2)),,
                             Other:NEXT(58$);

58$           RELEASE:       Member(TransSet2, Trans_No2),1;
183$          TALLY:         time for putaway from d2,tnow-beginning time for putaway from d1,1;
155$          ASSIGN:        #unloaded2=#unloaded2+1:NEXT(60$);


;
;
;     Model statements for module:  Decide 56
;
60$           BRANCH,        1:
                             If,#unloaded2==truckcap,328$,Yes:
                             Else,329$,Yes;
328$          ASSIGN:        Decide 56.NumberOut True=Decide 56.NumberOut True + 1:NEXT(61$);

329$          ASSIGN:        Decide 56.NumberOut False=Decide 56.NumberOut False + 1:NEXT(59$);


;
;
;     Model statements for module:  Release 15
;
61$           RELEASE:       dock2,1:NEXT(122$);

122$          TALLY:         time in system from d2,tnow-receiptqenter,1;
156$          ASSIGN:        #unloaded2=#unloaded2-#unloaded2:NEXT(59$);


;
;
;     Model statements for module:  Dispose 15
;
59$           ASSIGN:        Dispose 15.NumberOut=Dispose 15.NumberOut + 1;
330$          DISPOSE:       Yes;


;
;
;     Model statements for module:  Delay 15
;
224$          DELAY:         SecondsToBaseTime(((34.521+(0.915*averagedistance)+Norm(0,7.3))*2)),,Other:NEXT(58$);


;
;
;     Model statements for module:  Assign 182
;
202$          ASSIGN:        width2=
                             (LocationA(i,1)==1)*4+(LocationA(i,1)==2)*3+(LocationA(i,1)==3)*2+(LocationA(i,1)==4)*1+(LocationA(i,1)==5)*0:
                             distance2=23+i*1+width2:NEXT(12$);


;
;
;     Model statements for module:  Decide 4
;
9$            BRANCH,        1:
                             If,
                             ((LocationB(i,1) == 0) ||  ( (producttype  ==  LocationB (i,2)) && (LocationB(i,1) < Capacity) )),
                             331$,Yes:
                             Else,332$,Yes;
331$          ASSIGN:        Decide 4.NumberOut True=Decide 4.NumberOut True + 1:NEXT(5$);

332$          ASSIGN:        Decide 4.NumberOut False=Decide 4.NumberOut False + 1:NEXT(70$);

5$            ASSIGN:        LocationB(i,1)=LocationB(i,1)+1:
                             LocationB(i,2)=producttype:NEXT(11$);


;
;
;     Model statements for module:  Assign 12
;
11$           ASSIGN:        Locationtype=2:NEXT(204$);


;
;
;     Model statements for module:  Decide 223
;
204$          BRANCH,        1:
                             If,dockno==1,333$,Yes:
                             Else,334$,Yes;
333$          ASSIGN:        Decide 223.NumberOut True=Decide 223.NumberOut True + 1:NEXT(205$);

334$          ASSIGN:        Decide 223.NumberOut False=Decide 223.NumberOut False + 1:NEXT(206$);


;
;
;     Model statements for module:  Assign 184
;
205$          ASSIGN:        width3=
                             (LocationB(i,1)==1)*4+(LocationB(i,1)==2)*3+(LocationB(i,1)==3)*2+(LocationB(i,1)==4)*1+(LocationB(i,1)==5)*0:
                             distance3=20+i*1+width3:NEXT(12$);


;
;
;     Model statements for module:  Assign 186
;
206$          ASSIGN:        width4=
                             (LocationB(i,1)==1)*4+(LocationB(i,1)==2)*3+(LocationB(i,1)==3)*2+(LocationB(i,1)==4)*1+(LocationB(i,1)==5)*0:
                             distance4=23+i*1+width4:NEXT(12$);


;
;
;     Model statements for module:  Decide 67
;
70$           BRANCH,        1:
                             If,((LocationC(i,1) == 0) ||  ( (producttype  ==  LocationC (i,2)) && (LocationC(i,1) < 8) )),335$,
                             Yes:
                             Else,336$,Yes;
335$          ASSIGN:        Decide 67.NumberOut True=Decide 67.NumberOut True + 1:NEXT(71$);

336$          ASSIGN:        Decide 67.NumberOut False=Decide 67.NumberOut False + 1:NEXT(89$);

71$           ASSIGN:        LocationC(i,1)=LocationC(i,1)+1:
                             LocationC(i,2)=producttype:NEXT(72$);


;
;
;     Model statements for module:  Assign 49
;
72$           ASSIGN:        Locationtype=3:NEXT(73$);


;
;
;     Model statements for module:  Decide 68
;
73$           BRANCH,        1:
                             If,dockno==1,337$,Yes:
                             Else,338$,Yes;
337$          ASSIGN:        Decide 68.NumberOut True=Decide 68.NumberOut True + 1:NEXT(74$);

338$          ASSIGN:        Decide 68.NumberOut False=Decide 68.NumberOut False + 1:NEXT(75$);


;
;
;     Model statements for module:  Assign 51
;
74$           ASSIGN:        width5=
                             (LocationC(i,1)==1)*7+(LocationC(i,1)==2)*6+(LocationC(i,1)==3)*5+(LocationC(i,1)==4)*4+(LocationC(i,1)==5)*3+(LocationC(i,1)==6)*2+(LocationC(i,1)==7)*1+(LocationC(i,1)==8)*0:
                             distance5=13+i*1+width5:NEXT(12$);


;
;
;     Model statements for module:  Assign 52
;
75$           ASSIGN:        width6=
                             (LocationC(i,1)==1)*7+(LocationC(i,1)==2)*6+(LocationC(i,1)==3)*5+(LocationC(i,1)==4)*4+(LocationC(i,1)==5)*3+(LocationC(i,1)==6)*2+(LocationC(i,1)==7)*1+(LocationC(i,1)==8)*0:
                             distance6=14+i*1+width6:NEXT(12$);


;
;
;     Model statements for module:  Decide 110
;
89$           BRANCH,        1:
                             If,((LocationD(i,1) == 0) ||  ( (producttype  ==  LocationD (i,2)) && (LocationD(i,1) < 8) )),339$,
                             Yes:
                             Else,340$,Yes;
339$          ASSIGN:        Decide 110.NumberOut True=Decide 110.NumberOut True + 1:NEXT(90$);

340$          ASSIGN:        Decide 110.NumberOut False=Decide 110.NumberOut False + 1:NEXT(8$);

90$           ASSIGN:        LocationD(i,1)=LocationD(i,1)+1:
                             LocationD(i,2)=producttype:NEXT(91$);


;
;
;     Model statements for module:  Assign 76
;
91$           ASSIGN:        Locationtype=4:NEXT(207$);


;
;
;     Model statements for module:  Decide 224
;
207$          BRANCH,        1:
                             If,dockno==1,341$,Yes:
                             Else,342$,Yes;
341$          ASSIGN:        Decide 224.NumberOut True=Decide 224.NumberOut True + 1:NEXT(208$);

342$          ASSIGN:        Decide 224.NumberOut False=Decide 224.NumberOut False + 1:NEXT(209$);


;
;
;     Model statements for module:  Assign 189
;
208$          ASSIGN:        width7=
                             (LocationD(i,1)==1)*7+(LocationD(i,1)==2)*6+(LocationD(i,1)==3)*5+(LocationD(i,1)==4)*4+(LocationD(i,1)==5)*3+(LocationD(i,1)==6)*2+(LocationD(i,1)==7)*1+(LocationD(i,1)==8)*0:
                             distance7=13+i*1+width7:NEXT(12$);


;
;
;     Model statements for module:  Assign 190
;
209$          ASSIGN:        width8=
                             (LocationD(i,1)==1)*7+(LocationD(i,1)==2)*6+(LocationD(i,1)==3)*5+(LocationD(i,1)==4)*4+(LocationD(i,1)==5)*3+(LocationD(i,1)==6)*2+(LocationD(i,1)==7)*1+(LocationD(i,1)==8)*0:
                             distance8=14+i*1+width8:NEXT(12$);


;
;
;     Model statements for module:  Assign 10
;
8$            ASSIGN:        i=i+1:NEXT(220$);


;
;
;     Model statements for module:  Decide 228
;
220$          BRANCH,        1:
                             If,i<=289,343$,Yes:
                             Else,344$,Yes;
343$          ASSIGN:        Decide 228.NumberOut True=Decide 228.NumberOut True + 1:NEXT(13$);

344$          ASSIGN:        Decide 228.NumberOut False=Decide 228.NumberOut False + 1:NEXT(221$);


;
;
;     Model statements for module:  Assign 196
;
221$          ASSIGN:        stock exceeded=1:NEXT(216$);


;
;
;     Model statements for module:  Decide 227
;
216$          BRANCH,        1:
                             If,producttype==1,217$,Yes:
                             If,producttype==2,218$,Yes:
                             Else,219$,Yes;
219$          ASSIGN:        stock3=stock3+1:NEXT(53$);

217$          ASSIGN:        stock1=stock1+1:NEXT(53$);

218$          ASSIGN:        stock2=stock2+1:NEXT(53$);

178$          TALLY:         time in receiptq at d2,tnow-receiptqenter,1:NEXT(21$);


;
;
;     Model statements for module:  Assign 15
;
21$           ASSIGN:        truckcap=8:
                             dockno=2:NEXT(22$);

22$           DUPLICATE:     truckcap-1,69$:NEXT(69$);


;
;
;     Model statements for module:  Process 2
;
69$           ASSIGN:        Process 2.NumberIn=Process 2.NumberIn + 1:
                             Process 2.WIP=Process 2.WIP+1;
376$          STACK,         1:Save:NEXT(350$);

350$          QUEUE,         Process 2.Queue;
349$          SEIZE,         1,VA:
                             SELECT(TransSet5,SNB, ),1:NEXT(348$);

348$          DELAY:         SecondsToBaseTime(UNIF(62,83,62)),,VA:NEXT(391$);

391$          ASSIGN:        Process 2.WaitTime=Process 2.WaitTime + Diff.WaitTime;
355$          TALLY:         Process 2.WaitTimePerEntity,Diff.WaitTime,1;
357$          TALLY:         Process 2.TotalTimePerEntity,Diff.StartTime,1;
381$          ASSIGN:        Process 2.VATime=Process 2.VATime + Diff.VATime;
382$          TALLY:         Process 2.VATimePerEntity,Diff.VATime,1;
347$          RELEASE:       SELECT(TransSet5,LAST),1;
396$          STACK,         1:Destroy:NEXT(395$);

395$          ASSIGN:        Process 2.NumberOut=Process 2.NumberOut + 1:
                             Process 2.WIP=Process 2.WIP-1:NEXT(181$);


;
;
;     Model statements for module:  Assign 111
;
181$          ASSIGN:        beginning time for putaway from d2=tnow:NEXT(104$);

118$          COUNT:         receiptatruck,1:NEXT(112$);

120$          COUNT:         receiptbtruck,1:NEXT(112$);


;
;
;     Model statements for module:  Create 115
;

398$          CREATE,        1,NSEXPO(schedule for departure arrivals),departure:NSEXPO(schedule for departure arrivals)
                             :NEXT(399$);

399$          ASSIGN:        Create 115.NumberOut=Create 115.NumberOut + 1:NEXT(237$);


;
;
;     Model statements for module:  Assign 201
;
237$          ASSIGN:        type=disc(0.6,1,0.9,2,1,3):NEXT(97$);


;
;
;     Model statements for module:  Decide 115
;
97$           BRANCH,        1:
                             If,type==1,107$,Yes:
                             If,type==2,108$,Yes:
                             Else,109$,Yes;

;
;
;     Model statements for module:  Decide 120
;
109$          BRANCH,        1:
                             If,product3stock>=safety stock,404$,Yes:
                             Else,405$,Yes;
404$          ASSIGN:        Decide 120.NumberOut True=Decide 120.NumberOut True + 1:NEXT(163$);

405$          ASSIGN:        Decide 120.NumberOut False=Decide 120.NumberOut False + 1:NEXT(99$);

163$          COUNT:         dispatchctruck,1:NEXT(23$);


;
;
;     Model statements for module:  Assign 23
;
23$           ASSIGN:        ordersize=8:
                             shipmentqenter=tnow:NEXT(67$);

67$           ASSIGN:        product2stock=(type==2)*(product2stock-8)+(type<>2)*(product2stock-0):
                             product3stock=(type==3)*(product3stock-8)+(type<>3)*(product3stock-0):
                             product1stock=(type==1)*(product1stock-8)+(type<>1)*(product1stock-0);
105$          WRITE,         stock:
                             totalstock,
                             tnow;
111$          QUEUE,         shipmentdockqueue;
102$          SEIZE,         1,Other:
                             SELECT(S_docks,LRC,s_index),1:NEXT(103$);


;
;
;     Model statements for module:  Decide 117
;
103$          BRANCH,        1:
                             If,s_docks(s_index)==dock1,406$,Yes:
                             Else,407$,Yes;
406$          ASSIGN:        Decide 117.NumberOut True=Decide 117.NumberOut True + 1:NEXT(114$);

407$          ASSIGN:        Decide 117.NumberOut False=Decide 117.NumberOut False + 1:NEXT(179$);

114$          TALLY:         time in shipmentq at d1,tnow-shipmentqenter,1:NEXT(65$);


;
;
;     Model statements for module:  Assign 47
;
65$           ASSIGN:        dock_no=1:
                             leave the dock1 queue=tnow:NEXT(25$);

25$           DUPLICATE:     ordersize-1,24$:NEXT(24$);


;
;
;     Model statements for module:  Assign 24
;
24$           ASSIGN:        picked=0:
                             k=1:
                             totalstock=product1stock+product2stock+product3stock:
                             totalexceedingstock=stock1+stock2+stock3:NEXT(26$);

26$           WHILE:         (picked==0):NEXT(27$);


;
;
;     Model statements for module:  Decide 17
;
27$           BRANCH,        1:
                             If,( LocationA(k,1) <> 0  )  &&  ( type == LocationA(k,2) ),408$,Yes:
                             Else,409$,Yes;
408$          ASSIGN:        Decide 17.NumberOut True=Decide 17.NumberOut True + 1:NEXT(28$);

409$          ASSIGN:        Decide 17.NumberOut False=Decide 17.NumberOut False + 1:NEXT(32$);

28$           ASSIGN:        LocationA(k,1)=LocationA(k,1)-1:NEXT(29$);


;
;
;     Model statements for module:  Assign 27
;
29$           ASSIGN:        picked=1:
                             Locationtype=1:NEXT(30$);


;
;
;     Model statements for module:  Decide 18
;
30$           BRANCH,        1:
                             If,LocationA(k,1)==0,410$,Yes:
                             Else,411$,Yes;
410$          ASSIGN:        Decide 18.NumberOut True=Decide 18.NumberOut True + 1:NEXT(31$);

411$          ASSIGN:        Decide 18.NumberOut False=Decide 18.NumberOut False + 1:NEXT(62$);

31$           ASSIGN:        LocationA(k,2)=0:NEXT(62$);


;
;
;     Model statements for module:  Decide 57
;
62$           BRANCH,        1:
                             If,dock_no==1,412$,Yes:
                             Else,413$,Yes;
412$          ASSIGN:        Decide 57.NumberOut True=Decide 57.NumberOut True + 1:NEXT(63$);

413$          ASSIGN:        Decide 57.NumberOut False=Decide 57.NumberOut False + 1:NEXT(64$);


;
;
;     Model statements for module:  Assign 43
;
63$           ASSIGN:        width9=
                             (LocationA(k,1)==4)*0+(LocationA(k,1)==3)*1+(LocationA(k,1)==2)*2+(LocationA(k,1)==1)*3+(LocationA(k,1)==0)*4:
                             distance9=20+k*1+width9:NEXT(37$);

37$           ENDWHILE:NEXT(41$);


;
;
;     Model statements for module:  Decide 22
;
41$           BRANCH,        1:
                             If,dock_no==1,414$,Yes:
                             Else,415$,Yes;
414$          ASSIGN:        Decide 22.NumberOut True=Decide 22.NumberOut True + 1:NEXT(39$);

415$          ASSIGN:        Decide 22.NumberOut False=Decide 22.NumberOut False + 1:NEXT(49$);


;
;
;     Model statements for module:  Seize 9
;
39$           QUEUE,         Seize 9.Queue;
              SEIZE,         2,Other:
                             SELECT(TransSet3,CYC, trans_no3),1:NEXT(417$);

417$          DELAY:         0.0,,VA:NEXT(232$);


;
;
;     Model statements for module:  Decide 233
;
232$          BRANCH,        1:
                             If,departure from stock exceeded<>1,418$,Yes:
                             Else,419$,Yes;
418$          ASSIGN:        Decide 233.NumberOut True=Decide 233.NumberOut True + 1:NEXT(42$);

419$          ASSIGN:        Decide 233.NumberOut False=Decide 233.NumberOut False + 1:NEXT(233$);


;
;
;     Model statements for module:  Delay 5
;
42$           DELAY:         
                             SecondsToBaseTime((Locationtype==1)*((34.521+(0.915*distance9)+NORM(0,7.3))*2)+(Locationtype==2)*((34.521+(0.915*distance11)+NORM(0,7.3))*2)+(Locationtype==3)*((34.521+(0.915*distance13)+NORM(0,7.3))*2)+(Locationtype==4)*((34.521+(0.915*distance15)+NORM(0,7.3))*2)),,
                             Other:NEXT(86$);

86$           RELEASE:       Member(TransSet3, trans_no3),1;
189$          ASSIGN:        #product from d1=#product from d1+1:NEXT(128$);


;
;
;     Model statements for module:  Decide 123
;
128$          BRANCH,        1:
                             If,#product from d1==8,420$,Yes:
                             Else,421$,Yes;
420$          ASSIGN:        Decide 123.NumberOut True=Decide 123.NumberOut True + 1:NEXT(167$);

421$          ASSIGN:        Decide 123.NumberOut False=Decide 123.NumberOut False + 1:NEXT(197$);

167$          TALLY:         time for pickup to d1,tnow-leave the dock1 queue,1;
190$          ASSIGN:        #product from d1=#product from d1-#product from d1:NEXT(85$);


;
;
;     Model statements for module:  Process 5
;
85$           ASSIGN:        Process 5.NumberIn=Process 5.NumberIn + 1:
                             Process 5.WIP=Process 5.WIP+1;
451$          STACK,         1:Save:NEXT(425$);

425$          QUEUE,         Process 5.Queue;
424$          SEIZE,         1,VA:
                             SELECT(TransSet4,SNB, ),1:NEXT(423$);

423$          DELAY:         SecondsToBaseTime(UNIF(62,83,63)),,VA:NEXT(466$);

466$          ASSIGN:        Process 5.WaitTime=Process 5.WaitTime + Diff.WaitTime;
430$          TALLY:         Process 5.WaitTimePerEntity,Diff.WaitTime,1;
432$          TALLY:         Process 5.TotalTimePerEntity,Diff.StartTime,1;
456$          ASSIGN:        Process 5.VATime=Process 5.VATime + Diff.VATime;
457$          TALLY:         Process 5.VATimePerEntity,Diff.VATime,1;
422$          RELEASE:       SELECT(TransSet4,LAST),1;
471$          STACK,         1:Destroy:NEXT(470$);

470$          ASSIGN:        Process 5.NumberOut=Process 5.NumberOut + 1:
                             Process 5.WIP=Process 5.WIP-1:NEXT(157$);

157$          ASSIGN:        #loaded1=#loaded1+1:NEXT(45$);


;
;
;     Model statements for module:  Decide 38
;
45$           BRANCH,        1:
                             If,#loaded1==ordersize,473$,Yes:
                             Else,474$,Yes;
473$          ASSIGN:        Decide 38.NumberOut True=Decide 38.NumberOut True + 1:NEXT(43$);

474$          ASSIGN:        Decide 38.NumberOut False=Decide 38.NumberOut False + 1:NEXT(44$);


;
;
;     Model statements for module:  Release 13
;
43$           RELEASE:       dock1,1:NEXT(158$);

158$          ASSIGN:        #loaded1=#loaded1-#loaded1;
169$          TALLY:         time in system from d1 for shipment,tnow-shipmentqenter,1;
174$          COUNT:         # of trucks that are in system  more than 60 minutes from d1,(tnow-shipmentqenter)>60;
184$          COUNT:         # of trucks that are in system  more than 45 minutes from d1,(tnow-shipmentqenter)>45;
175$          COUNT:         #of trucks that are from d1,1;
187$          TALLY:         time for loading at d1,tnow-starting time of loading at d1,1:NEXT(44$);


;
;
;     Model statements for module:  Dispose 13
;
44$           ASSIGN:        Dispose 13.NumberOut=Dispose 13.NumberOut + 1;
475$          DISPOSE:       Yes;

197$          ASSIGN:        #product being loaded from d1=#product being loaded from d1+1:NEXT(199$);


;
;
;     Model statements for module:  Decide 219
;
199$          BRANCH,        1:
                             If,#product being loaded from d1==1,476$,Yes:
                             Else,477$,Yes;
476$          ASSIGN:        Decide 219.NumberOut True=Decide 219.NumberOut True + 1:NEXT(198$);

477$          ASSIGN:        Decide 219.NumberOut False=Decide 219.NumberOut False + 1:NEXT(200$);


;
;
;     Model statements for module:  Assign 177
;
198$          ASSIGN:        starting time of loading at d1=tnow:NEXT(85$);


;
;
;     Model statements for module:  Decide 220
;
200$          BRANCH,        1:
                             If,#product being loaded from d1==7,478$,Yes:
                             Else,479$,Yes;
478$          ASSIGN:        Decide 220.NumberOut True=Decide 220.NumberOut True + 1:NEXT(201$);

479$          ASSIGN:        Decide 220.NumberOut False=Decide 220.NumberOut False + 1:NEXT(85$);

201$          ASSIGN:        #product being loaded from d1=#product being loaded from d1-#product being loaded from d1:NEXT(85$);


;
;
;     Model statements for module:  Delay 17
;
233$          DELAY:         SecondsToBaseTime(((34.521+(0.915*averagedistance)+Norm(0,7.3))*2)),,Other:NEXT(86$);


;
;
;     Model statements for module:  Seize 12
;
49$           QUEUE,         Seize 12.Queue;
              SEIZE,         2,Other:
                             SELECT(TransSet6,CYC, trans_no6),1:NEXT(481$);

481$          DELAY:         0.0,,VA:NEXT(234$);


;
;
;     Model statements for module:  Decide 234
;
234$          BRANCH,        1:
                             If,departure from stock exceeded<>1,482$,Yes:
                             Else,483$,Yes;
482$          ASSIGN:        Decide 234.NumberOut True=Decide 234.NumberOut True + 1:NEXT(51$);

483$          ASSIGN:        Decide 234.NumberOut False=Decide 234.NumberOut False + 1:NEXT(235$);


;
;
;     Model statements for module:  Delay 8
;
51$           DELAY:         
                             SecondsToBaseTime((Locationtype==1)*((34.521+(0.915*distance10)+NORM(0,7.3))*2)+(Locationtype==2)*((34.521+(0.915*distance12)+NORM(0,7.3))*2)+(Locationtype==3)*((34.521+(0.915*distance14)+NORM(0,7.3))*2)+(Locationtype==4)*((34.521+(0.915*distance16)+NORM(0,7.3))*2)),,
                             Other:NEXT(52$);

52$           RELEASE:       Member(TransSet6, Trans_No6),1;
191$          ASSIGN:        #product from d2=#product from d2+1:NEXT(127$);


;
;
;     Model statements for module:  Decide 122
;
127$          BRANCH,        1:
                             If,#product from d2==8,484$,Yes:
                             Else,485$,Yes;
484$          ASSIGN:        Decide 122.NumberOut True=Decide 122.NumberOut True + 1:NEXT(168$);

485$          ASSIGN:        Decide 122.NumberOut False=Decide 122.NumberOut False + 1:NEXT(193$);

168$          TALLY:         time for pickup to d2,tnow-leave the dock2 queue,1;
192$          ASSIGN:        #product from d2=#product from d2-#product from d2:NEXT(76$);


;
;
;     Model statements for module:  Process 4
;
76$           ASSIGN:        Process 4.NumberIn=Process 4.NumberIn + 1:
                             Process 4.WIP=Process 4.WIP+1;
515$          STACK,         1:Save:NEXT(489$);

489$          QUEUE,         Process 4.Queue;
488$          SEIZE,         1,VA:
                             SELECT(TransSet5,SNB, ),1:NEXT(487$);

487$          DELAY:         SecondsToBaseTime(UNIF(62,83,64)),,VA:NEXT(530$);

530$          ASSIGN:        Process 4.WaitTime=Process 4.WaitTime + Diff.WaitTime;
494$          TALLY:         Process 4.WaitTimePerEntity,Diff.WaitTime,1;
496$          TALLY:         Process 4.TotalTimePerEntity,Diff.StartTime,1;
520$          ASSIGN:        Process 4.VATime=Process 4.VATime + Diff.VATime;
521$          TALLY:         Process 4.VATimePerEntity,Diff.VATime,1;
486$          RELEASE:       SELECT(TransSet5,LAST),1;
535$          STACK,         1:Destroy:NEXT(534$);

534$          ASSIGN:        Process 4.NumberOut=Process 4.NumberOut + 1:
                             Process 4.WIP=Process 4.WIP-1:NEXT(159$);

159$          ASSIGN:        #loaded2=#loaded2+1:NEXT(46$);


;
;
;     Model statements for module:  Decide 39
;
46$           BRANCH,        1:
                             If,#loaded2==ordersize,537$,Yes:
                             Else,538$,Yes;
537$          ASSIGN:        Decide 39.NumberOut True=Decide 39.NumberOut True + 1:NEXT(47$);

538$          ASSIGN:        Decide 39.NumberOut False=Decide 39.NumberOut False + 1:NEXT(48$);


;
;
;     Model statements for module:  Release 14
;
47$           RELEASE:       dock2,1:NEXT(160$);

160$          ASSIGN:        #loaded2=#loaded2-#loaded2;
170$          TALLY:         time in system from d2 for shipment,tnow-shipmentqenter,1;
176$          COUNT:         # of trucks that are in system  more than 60 minutes from d2,(tnow-shipmentqenter)>60;
185$          COUNT:         # of trucks that are in system  more than 45 minutes from d2,(tnow-shipmentqenter)>45;
177$          COUNT:         #of trucks that are from d2,1;
188$          TALLY:         time for loading at d2,tnow-starting time of loading at d2,1:NEXT(48$);


;
;
;     Model statements for module:  Dispose 14
;
48$           ASSIGN:        Dispose 14.NumberOut=Dispose 14.NumberOut + 1;
539$          DISPOSE:       Yes;

193$          ASSIGN:        #product being loaded from d2=#product being loaded from d2+1:NEXT(194$);


;
;
;     Model statements for module:  Decide 217
;
194$          BRANCH,        1:
                             If,#product being loaded from d2==1,540$,Yes:
                             Else,541$,Yes;
540$          ASSIGN:        Decide 217.NumberOut True=Decide 217.NumberOut True + 1:NEXT(186$);

541$          ASSIGN:        Decide 217.NumberOut False=Decide 217.NumberOut False + 1:NEXT(195$);


;
;
;     Model statements for module:  Assign 176
;
186$          ASSIGN:        starting time of loading at d2=tnow:NEXT(76$);


;
;
;     Model statements for module:  Decide 218
;
195$          BRANCH,        1:
                             If,#product being loaded from d2==7,542$,Yes:
                             Else,543$,Yes;
542$          ASSIGN:        Decide 218.NumberOut True=Decide 218.NumberOut True + 1:NEXT(196$);

543$          ASSIGN:        Decide 218.NumberOut False=Decide 218.NumberOut False + 1:NEXT(76$);

196$          ASSIGN:        #product being loaded from d2=#product being loaded from d2-#product being loaded from d2:NEXT(76$);


;
;
;     Model statements for module:  Delay 21
;
235$          DELAY:         SecondsToBaseTime(((34.521+(0.915*averagedistance)+Norm(0,7.3))*2)),,Other:NEXT(52$);


;
;
;     Model statements for module:  Assign 44
;
64$           ASSIGN:        width10=
                             (LocationA(k,1)==4)*0+(LocationA(k,1)==3)*1+(LocationA(k,1)==2)*2+(LocationA(k,1)==1)*3+(LocationA(k,1)==0)*4:
                             distance10=23+k*1+width10:NEXT(37$);


;
;
;     Model statements for module:  Decide 19
;
32$           BRANCH,        1:
                             If,( LocationB(k,1) <> 0 )  &&  ( type == LocationB(k,2) ),544$,Yes:
                             Else,545$,Yes;
544$          ASSIGN:        Decide 19.NumberOut True=Decide 19.NumberOut True + 1:NEXT(33$);

545$          ASSIGN:        Decide 19.NumberOut False=Decide 19.NumberOut False + 1:NEXT(77$);

33$           ASSIGN:        LocationB(k,1)=LocationB(k,1)-1:NEXT(34$);


;
;
;     Model statements for module:  Assign 30
;
34$           ASSIGN:        picked=1:
                             Locationtype=2:NEXT(35$);


;
;
;     Model statements for module:  Decide 21
;
35$           BRANCH,        1:
                             If,LocationB(k,1)==0,546$,Yes:
                             Else,547$,Yes;
546$          ASSIGN:        Decide 21.NumberOut True=Decide 21.NumberOut True + 1:NEXT(36$);

547$          ASSIGN:        Decide 21.NumberOut False=Decide 21.NumberOut False + 1:NEXT(210$);

36$           ASSIGN:        LocationB(k,2)=0:NEXT(210$);


;
;
;     Model statements for module:  Decide 225
;
210$          BRANCH,        1:
                             If,dock_no==1,548$,Yes:
                             Else,549$,Yes;
548$          ASSIGN:        Decide 225.NumberOut True=Decide 225.NumberOut True + 1:NEXT(211$);

549$          ASSIGN:        Decide 225.NumberOut False=Decide 225.NumberOut False + 1:NEXT(212$);


;
;
;     Model statements for module:  Assign 191
;
211$          ASSIGN:        width11=
                             (LocationB(k,1)==4)*0+(LocationB(k,1)==3)*1+(LocationB(k,1)==2)*2+(LocationB(k,1)==1)*3+(LocationB(k,1)==0)*4:
                             distance11=20+k*1+width11:NEXT(37$);


;
;
;     Model statements for module:  Assign 192
;
212$          ASSIGN:        width12=
                             (LocationB(k,1)==4)*0+(LocationB(k,1)==3)*1+(LocationB(k,1)==2)*2+(LocationB(k,1)==1)*3+(LocationB(k,1)==0)*4:
                             distance12=23+k*1+width12:NEXT(37$);


;
;
;     Model statements for module:  Decide 82
;
77$           BRANCH,        1:
                             If,( LocationC(k,1) <> 0 )  &&  ( type == LocationC(k,2) ),550$,Yes:
                             Else,551$,Yes;
550$          ASSIGN:        Decide 82.NumberOut True=Decide 82.NumberOut True + 1:NEXT(78$);

551$          ASSIGN:        Decide 82.NumberOut False=Decide 82.NumberOut False + 1:NEXT(92$);

78$           ASSIGN:        LocationC(k,1)=LocationC(k,1)-1:NEXT(79$);


;
;
;     Model statements for module:  Assign 53
;
79$           ASSIGN:        picked=1:
                             Locationtype=3:NEXT(80$);


;
;
;     Model statements for module:  Decide 83
;
80$           BRANCH,        1:
                             If,LocationC(k,1)==0,552$,Yes:
                             Else,553$,Yes;
552$          ASSIGN:        Decide 83.NumberOut True=Decide 83.NumberOut True + 1:NEXT(81$);

553$          ASSIGN:        Decide 83.NumberOut False=Decide 83.NumberOut False + 1:NEXT(82$);

81$           ASSIGN:        LocationC(k,2)=0:NEXT(82$);


;
;
;     Model statements for module:  Decide 84
;
82$           BRANCH,        1:
                             If,dock_no==1,554$,Yes:
                             Else,555$,Yes;
554$          ASSIGN:        Decide 84.NumberOut True=Decide 84.NumberOut True + 1:NEXT(83$);

555$          ASSIGN:        Decide 84.NumberOut False=Decide 84.NumberOut False + 1:NEXT(84$);


;
;
;     Model statements for module:  Assign 55
;
83$           ASSIGN:        width13=
                             (LocationC(k,1)==7)*0+(LocationC(k,1)==6)*1+(LocationC(k,1)==5)*2+(LocationC(k,1)==4)*3+(LocationC(k,1)==3)*4+(LocationC(k,1)==2)*5+(LocationC(k,1)==1)*6+(LocationC(k,1)==0)*7:
                             distance13=13+k*1+width13:NEXT(37$);


;
;
;     Model statements for module:  Assign 56
;
84$           ASSIGN:        width14=
                             (LocationC(k,1)==7)*0+(LocationC(k,1)==6)*1+(LocationC(k,1)==5)*2+(LocationC(k,1)==4)*3+(LocationC(k,1)==3)*4+(LocationC(k,1)==2)*5+(LocationC(k,1)==1)*6+(LocationC(k,1)==0)*7:
                             distance14=14+k*1+width14:NEXT(37$);


;
;
;     Model statements for module:  Decide 111
;
92$           BRANCH,        1:
                             If,( LocationD(k,1) <> 0 )  &&  ( type == LocationD(k,2) ),556$,Yes:
                             Else,557$,Yes;
556$          ASSIGN:        Decide 111.NumberOut True=Decide 111.NumberOut True + 1:NEXT(93$);

557$          ASSIGN:        Decide 111.NumberOut False=Decide 111.NumberOut False + 1:NEXT(38$);

93$           ASSIGN:        LocationD(k,1)=LocationD(k,1)-1:NEXT(94$);


;
;
;     Model statements for module:  Assign 77
;
94$           ASSIGN:        picked=1:
                             Locationtype=4:NEXT(95$);


;
;
;     Model statements for module:  Decide 112
;
95$           BRANCH,        1:
                             If,LocationD(k,1)==0,558$,Yes:
                             Else,559$,Yes;
558$          ASSIGN:        Decide 112.NumberOut True=Decide 112.NumberOut True + 1:NEXT(96$);

559$          ASSIGN:        Decide 112.NumberOut False=Decide 112.NumberOut False + 1:NEXT(213$);

96$           ASSIGN:        LocationD(k,2)=0:NEXT(213$);


;
;
;     Model statements for module:  Decide 226
;
213$          BRANCH,        1:
                             If,dock_no==1,560$,Yes:
                             Else,561$,Yes;
560$          ASSIGN:        Decide 226.NumberOut True=Decide 226.NumberOut True + 1:NEXT(214$);

561$          ASSIGN:        Decide 226.NumberOut False=Decide 226.NumberOut False + 1:NEXT(215$);


;
;
;     Model statements for module:  Assign 193
;
214$          ASSIGN:        width15=
                             (LocationD(k,1)==7)*0+(LocationD(k,1)==6)*1+(LocationD(k,1)==5)*2+(LocationD(k,1)==4)*3+(LocationD(k,1)==3)*4+(LocationD(k,1)==2)*5+(LocationD(k,1)==1)*6+(LocationD(k,1)==0)*7:
                             distance15=13+k*1+width15:NEXT(37$);


;
;
;     Model statements for module:  Assign 194
;
215$          ASSIGN:        width16=
                             (LocationC(k,1)==7)*0+(LocationC(k,1)==6)*1+(LocationC(k,1)==5)*2+(LocationC(k,1)==4)*3+(LocationC(k,1)==3)*4+(LocationC(k,1)==2)*5+(LocationC(k,1)==1)*6+(LocationC(k,1)==0)*7:
                             distance16=14+k*1+width16:NEXT(37$);


;
;
;     Model statements for module:  Assign 32
;
38$           ASSIGN:        k=k+1:NEXT(226$);


;
;
;     Model statements for module:  Decide 231
;
226$          BRANCH,        1:
                             If,k<=289,562$,Yes:
                             Else,563$,Yes;
562$          ASSIGN:        Decide 231.NumberOut True=Decide 231.NumberOut True + 1:NEXT(37$);

563$          ASSIGN:        Decide 231.NumberOut False=Decide 231.NumberOut False + 1:NEXT(231$);


;
;
;     Model statements for module:  Assign 197
;
231$          ASSIGN:        departure from stock exceeded=1:NEXT(227$);


;
;
;     Model statements for module:  Decide 232
;
227$          BRANCH,        1:
                             If,type==1,228$,Yes:
                             If,type==2,229$,Yes:
                             Else,230$,Yes;
230$          ASSIGN:        stock3=stock3-1:NEXT(41$);

228$          ASSIGN:        stock1=stock1-1:NEXT(41$);

229$          ASSIGN:        stock2=stock2-1:NEXT(41$);

179$          TALLY:         time in shipmentq at d2,tnow-shipmentqenter,1:NEXT(66$);


;
;
;     Model statements for module:  Assign 48
;
66$           ASSIGN:        dock_no=2:
                             leave the dock2 queue=tnow:NEXT(25$);


;
;
;     Model statements for module:  Record 32
;
99$           COUNT:         #runaway,1:NEXT(98$);


;
;
;     Model statements for module:  Dispose 21
;
98$           ASSIGN:        Dispose 21.NumberOut=Dispose 21.NumberOut + 1;
566$          DISPOSE:       Yes;


;
;
;     Model statements for module:  Decide 118
;
107$          BRANCH,        1:
                             If,product1stock>=safety stock,567$,Yes:
                             Else,568$,Yes;
567$          ASSIGN:        Decide 118.NumberOut True=Decide 118.NumberOut True + 1:NEXT(161$);

568$          ASSIGN:        Decide 118.NumberOut False=Decide 118.NumberOut False + 1:NEXT(99$);

161$          COUNT:         dispatchatruck,1:NEXT(23$);


;
;
;     Model statements for module:  Decide 119
;
108$          BRANCH,        1:
                             If,product2stock>=safety stock,569$,Yes:
                             Else,570$,Yes;
569$          ASSIGN:        Decide 119.NumberOut True=Decide 119.NumberOut True + 1:NEXT(162$);

570$          ASSIGN:        Decide 119.NumberOut False=Decide 119.NumberOut False + 1:NEXT(99$);

162$          COUNT:         dispatchbtruck,1:NEXT(23$);


;
;
;     Model statements for module:  Create 116
;

571$          CREATE,        1,HoursToBaseTime(0.0),Entity 1:HoursToBaseTime(1):NEXT(572$);

572$          ASSIGN:        Create 116.NumberOut=Create 116.NumberOut + 1:NEXT(238$);


;
;
;     Model statements for module:  ReadWrite 1
;
238$          WRITE,         hourlyutil:
                             TNOW,
                             FRQTIM(forklift1,1),
                             FRQTIM(forklift1,2),
                             FRQTIM(forklift1,4),
                             FRQTIM(forklift2,1),
                             FRQTIM(forklift2,2),
                             FRQTIM(forklift2,4),
                             FRQTIM(forklift3,1),
                             FRQTIM(forklift3,2),
                             FRQTIM(forklift3,4),
                             FRQTIM(forklift4,1),
                             FRQTIM(forklift4,2),
                             FRQTIM(forklift4,4),
                             FRQTIM(forklift5,1),
                             FRQTIM(forklift5,2),
                             FRQTIM(forklift5,4),
                             FRQTIM(forklift6,1),
                             FRQTIM(forklift6,2),
                             FRQTIM(forklift6,4),
                             FRQTIM(forklift7,1),
                             FRQTIM(forklift7,2),
                             FRQTIM(forklift7,4),
                             nc(hour1#):NEXT(242$);


;
;
;     Model statements for module:  Record 33
;
242$          COUNT:         hour1#,1:NEXT(239$);


;
;
;     Model statements for module:  Dispose 32
;
239$          ASSIGN:        Dispose 32.NumberOut=Dispose 32.NumberOut + 1;
575$          DISPOSE:       Yes;


;
;
;     Model statements for module:  Create 117
;

576$          CREATE,        1,HoursToBaseTime(0),Entity 1:HoursToBaseTime(1):NEXT(577$);

577$          ASSIGN:        Create 117.NumberOut=Create 117.NumberOut + 1:NEXT(240$);


;
;
;     Model statements for module:  ReadWrite 2
;
240$          WRITE,         percentage of trucks that are more than 45 min:
                             tnow,
                             nc(# of trucks that are in system  more than 45 minutes from d1),
                             nc(#of trucks that are from d1),
                             nc(# of trucks that are in system  more than 45 minutes from d2),
                             nc(#of trucks that are from d2),
                             nc(receiptatruck),
                             nc(receiptbtruck),
                             nc(receiptctruck),
                             nc(dispatchatruck),
                             nc(dispatchbtruck),
                             nc(dispatchctruck),
                             nc(hour2#):NEXT(243$);


;
;
;     Model statements for module:  Record 34
;
243$          COUNT:         hour2#,1:NEXT(241$);


;
;
;     Model statements for module:  Dispose 33
;
241$          ASSIGN:        Dispose 33.NumberOut=Dispose 33.NumberOut + 1;
580$          DISPOSE:       Yes;


244$          CREATE,        1,TFIN::NEXT(245$);

245$          WRITE,         utilizationf7:
                             FSTAND(forklift7,1),FSTAND(forklift7,2),FSTAND(forklift7,4);
246$          DISPOSE:       No;









